import request from '@/utils/request.js'

// 文章分类: 获取文章分类列表
export const getChannelsAPI = () => request.get('/my/cate/list')

// 文章列表: 添加分类
export const addChannelsAPI = (data) => request.post('/my/cate/add', data)

// 文章列表: 编辑分类
export const editChannelsAPI = (data) => request.put('/my/cate/info', data)

// 文章列表: 删除分类
export const deleteChannelsAPI = (id) =>
  request.delete('/my/cate/del', { params: { id } })

// ------------------------------------------------------------------------------------

// 文章管理: 获取文章管理列表
export const getManageAPI = (params) =>
  request.get('/my/article/list', { params })

// 文章管理: 获取文章管理详情
export const getArticleAPI = (id) =>
  request.get('/my/article/info', { params: { id } })

// 文章管理: 添加文章
export const addArticleAPI = (data) => request.post('/my/article/add', data)

// 文章管理: 编辑文章
export const editArticleAPI = (data) => request.put('/my/article/info', data)

// 文章管理: 删除文章
export const deleteArticleAPI = (id) =>
  request.delete('/my/article/info', { params: { id } })
